// 方式1：import {} from "路径"；
// import { name, age, sayHello } from "./modules/foo.js";

// 方式2：导出变量后起别名
// import { name as wName, age as wAge, sayHello as wsayHello } from "./modules/foo.js";

// 方式3：* as 别名
// import * as foo from "./modules/foo.js";
// console.log(foo.name);
// console.log(foo.age);

import { name, age, sayHello } from "./modules/bar.js";
console.log(name);
console.log(age);
sayHello("kobe");

import format from "./modules/foo.js";
format();

// import 函数
// let flag = true;

import("./modules/foo.js").then(res => {
  console.log("在then中的打印");
  console.log(res.name);
  console.log(res.age);
}).catch(err => {
  
})